# -*- coding: utf-8 -*-
# TencentBlueKing is pleased to support the open source community by making
# 蓝鲸智云 - PaaS 平台 (BlueKing - PaaS System) available.
# Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
# Licensed under the MIT License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
#     http://opensource.org/licenses/MIT
#
# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific language governing permissions and
# limitations under the License.
#
# We undertake not to change the open source license (MIT license) applicable
# to the current version of the project delivered to anyone in the future.

# Generated by Django 3.2.12 on 2022-03-31 02:58
from django.db import migrations, models
from paasng.core.core.storages.dbrouter import skip_if_found_record


# 由于架构调整, 该 DjangoApp 从 services 重命名为 ingress
# 为避免 migrations 重复执行, 使用 skip_if_found_record 声明该 migration 的历史名称
# 如果 django_migrations 表中存在重命名前的执行记录, 则跳过执行该 Migration
@skip_if_found_record(sentinel=("services", "0004_auto_20220331_1058"))
class Migration(migrations.Migration):

    dependencies = [
        ('ingress', '0003_auto_20211020_1556'),
    ]

    operations = [
        migrations.AlterField(
            model_name='appdomain',
            name='source',
            field=models.IntegerField(choices=[(1, 'BUILT_IN'), (2, 'AUTO_GEN'), (3, 'INDEPENDENT')]),
        ),
        migrations.CreateModel(
            name='Domain',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('region', models.CharField(help_text='部署区域', max_length=32)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(help_text='域名', max_length=253)),
                ('path_prefix', models.CharField(default='/', help_text='the accessable path for current domain', max_length=64)),
                ('module_id', models.UUIDField(help_text='关联的模块 ID')),
                ('environment_id', models.BigIntegerField(help_text='关联的环境 ID')),
                ('lb_plan', models.CharField(default='LBDefaultPlan', max_length=64, verbose_name='load balancer plan')),
                ('https_enabled', models.NullBooleanField(default=False, help_text='该域名是否开启 https.')),
            ],
            options={
                'unique_together': {('name', 'path_prefix', 'module_id', 'environment_id')},
                'db_table': 'services_domain',
            },
        ),
    ]
